#ifndef STACK_H_INCLUDED
#define STACK_H_INCLUDED

#include <stddef.h>
//栈的实现
typedef struct _stackcursor StackCursor;
typedef struct _stack Stack;

Stack *StackInit();
void *StackPush(Stack *pstack,void *data);
void *StackPop(Stack *pstack);
int StackLength(Stack *pstack);
Stack *StackEmpty(Stack *pstack);
void *StackData(Stack *pstack);
void StackAllocator(Stack *pstack,void *(*pmalloc)(size_t size),void (*pfree)(void *pdata));
//枚举栈内函数,注意游标失效问题
StackCursor *StackGetCursor(Stack *pstack);
void *StackForeach(Stack *pstack,StackCursor *pcursor);





#endif // STACK_H_INCLUDED
